package com.midea.ai.air.ui.more;

import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.view.ViewGroup;
import android.widget.LinearLayout;
import android.widget.RelativeLayout;

import com.midea.ai.air.R;
import com.midea.ai.air.common.BaseActivity;
import com.midea.ai.air.common.Constant;
import com.midea.ai.air.ui.more.adapter.MoreSettingElectricityReportShowEleAdapter;
import com.midea.ai.air.ui.more.data.MoreElectricityShow;
import com.midea.ai.air.view.ListViewForScrollView;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by hww on 2016/4/23.
 * 电量报告-月电量报告详细
 */
public class MoreSettingElectricityReportShowEle extends BaseActivity implements View.OnClickListener {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_moresettingelectricityreportshowele);

        init();
    }

    private RelativeLayout bar_Rl;
    private LinearLayout back_left;
    private ListViewForScrollView mListView;
    private List<MoreElectricityShow> mList_Datas = new ArrayList<>();


    private void init() {
        bar_Rl = (RelativeLayout) findViewById(R.id.bar_parent_rl);
        ViewGroup.LayoutParams LP = bar_Rl.getLayoutParams();
        LP.height = Constant.getTopMargin() + getResources().getDimensionPixelSize(R.dimen.height_44dp);
        bar_Rl.setLayoutParams(LP);

        back_left = (LinearLayout) findViewById(R.id.left_relativeLayout_back);
        back_left.setOnClickListener(this);

        mListView = (ListViewForScrollView) findViewById(R.id.more_setting_electricity_report_show_ele_listView);

        Bundle bundle = this.getIntent().getExtras();
        int month = bundle.getInt(MoreSettingElectricityReport.MORE_SETTING_ELECTRICITY_YEAR);
        Log.i("hwwlog", "电量详细报告  position" + month);
        for (int i = 0; i < 12; i++) {
            mList_Datas.add(new MoreElectricityShow(2015 + "年" + month + "月" + (30 - i) + "日", "00.00"));
        }

        mListView.setAdapter(new MoreSettingElectricityReportShowEleAdapter(MoreSettingElectricityReportShowEle.this, mList_Datas));

    }

    @Override
    public void onClick(View v) {
        switch (v.getId()) {
            case R.id.left_relativeLayout_back:
                this.finish();
                break;
            default:
                break;
        }
    }
}
